package com.longxi.tianjintianbao.ui.activity.oa;

import android.content.Intent;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.longxi.tianjintianbao.R;
import com.longxi.tianjintianbao.ui.base.BaseActivity;
import com.longxi.tianjintianbao.ui.presenter.oa.CopeWithAtPresenter;
import com.longxi.tianjintianbao.ui.view.oa.ICopeWithAtView;

import butterknife.BindView;

public class CopeWithActivity extends BaseActivity<ICopeWithAtView, CopeWithAtPresenter> implements ICopeWithAtView {
    @BindView(R.id.etProjectName)
    EditText mEtProjectName;//请输入费用相关项目名称

    @BindView(R.id.etContent)
    EditText mEtContent;//供货内容

    @BindView(R.id.etUpperAmount)
    EditText mEtUpperAmount;//请输入申请金额大写
    @BindView(R.id.tvSwitch)
    TextView mTvSwitch;//转换按钮
    @BindView(R.id.etLowerAmount)
    EditText mEtLowerAmount;//请输入申请金额小写

    @BindView(R.id.etUpperPayedAmount)
    EditText mEtUpperPayedAmount;//请输入总金额大写
    @BindView(R.id.tvPayedSwitch)
    TextView mTvPayedSwitch;//转换总按钮
    @BindView(R.id.etLowerPayedAmount)
    EditText mEtLowerPayedAmount;//请输入总金额小写

    @BindView(R.id.etSupplier)
    EditText mEtSupplier;
    @BindView(R.id.etAccounts)
    EditText mEtAccounts;
    @BindView(R.id.etOpeningBank)
    EditText mEtOpeningBank;

    @BindView(R.id.etUpperApplyAmount)
    EditText mEtUpperApplyAmount;//请输入申请付额大写
    @BindView(R.id.tvApplySwitch)
    TextView mTvApplySwitch;//转换申请付额按钮
    @BindView(R.id.etLowerApplyAmount)
    EditText mEtLowerApplyAmount;//请输入申请付额小写

    @BindView(R.id.etUpperRatifyAmount)
    EditText mEtUpperRatifyAmount;//请输入批准金额大写
    @BindView(R.id.tvRatifySwitch)
    TextView mTvRatifySwitch;//转换批准金额按钮
    @BindView(R.id.etLowerRatifyAmount)
    EditText mEtLowerRatifyAmount;//请输入批准金额小写

    @BindView(R.id.tvAuditingName)
    TextView mTvAuditingName;
    @BindView(R.id.tvPersonnelName)
    TextView mTvPersonnelName;

    @BindView(R.id.btnLogin)
    Button mBtnLogin;

    @Override
    protected int provideContentViewId() {
        return R.layout.activity_cope_with;
    }

    @Override
    public void initData() {
        super.initData();
        mPresenter.setBar();
    }

    @Override
    public void initListener() {
        super.initListener();
        mBtnLogin.setOnClickListener(v -> mPresenter.saveCopeWith());
        mTvSwitch.setOnClickListener(v -> mPresenter.SwitchNumToUpper(getEtLowerAmount(), getEtUpperAmount()));
        mTvAuditingName.setOnClickListener(v -> mPresenter.showAuditing());
        mTvPersonnelName.setOnClickListener(v -> mPresenter.showPersonnel());

        mPresenter.onTextChanged(getEtLowerAmount(), getEtUpperAmount());
        mPresenter.onTextChanged(getEtLowerPayedAmount(), getEtUpperPayedAmount());
        mPresenter.onTextChanged(getEtLowerApplyAmount(), getEtUpperApplyAmount());
        mPresenter.onTextChanged(getEtLowerRatifyAmount(), getEtUpperRatifyAmount());

    }

    @Override
    protected CopeWithAtPresenter createPresenter() {
        return new CopeWithAtPresenter(this);
    }

    @Override
    public EditText getEtProjectName() {
        return mEtProjectName;
    }

    @Override
    public EditText getEtContent() {
        return mEtContent;
    }

    @Override
    public EditText getEtUpperAmount() {
        return mEtUpperAmount;
    }

    @Override
    public EditText getEtLowerAmount() {
        return mEtLowerAmount;
    }

    @Override
    public EditText getEtUpperPayedAmount() {
        return mEtUpperPayedAmount;
    }

    @Override
    public EditText getEtLowerPayedAmount() {
        return mEtLowerPayedAmount;
    }

    @Override
    public EditText getEtSupplier() {
        return mEtSupplier;
    }

    @Override
    public EditText getEtAccounts() {
        return mEtAccounts;
    }

    @Override
    public EditText getEtOpeningBank() {
        return mEtOpeningBank;
    }

    @Override
    public EditText getEtUpperApplyAmount() {
        return mEtUpperApplyAmount;
    }

    @Override
    public EditText getEtLowerApplyAmount() {
        return mEtLowerApplyAmount;
    }

    @Override
    public EditText getEtUpperRatifyAmount() {
        return mEtUpperRatifyAmount;
    }

    @Override
    public EditText getEtLowerRatifyAmount() {
        return mEtLowerRatifyAmount;
    }

    @Override
    public TextView getTvAuditingName() {
        return mTvAuditingName;
    }

    @Override
    public TextView getTvPersonnelName() {
        return mTvPersonnelName;
    }

    @Override
    public Button getBtnLogin() {
        return mBtnLogin;
    }


    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
    }

}


